(function() {
	var departments = ["President", "Vicepresident", "iOS"];
	
	$(function() {
		$.each(departments, function(index, value) {
			var listEl = $(".dept-panel-list-item.template").clone().appendTo("#dept-panel-list").removeClass("template");
			
			$("a", listEl).text(value).attr("id",value.toLowerCase());
			$("div", listEl).text(index);
		});
		
		$(".showDepts").click(function() {
			$("#dept-panel").slideToggle("slow");
		});			
		
		$.each(departments, function(index, value) {
			$("#"+value.toLowerCase()).click(function() {
			
			resetActual();
			
			var id = this.id;
			var numItems = $("." + id).length;
			var width = numItems * 113;
			$("#actual").css("width",width);
			move(id);
		});
			
		}); 
	});
})();
